import VueRouter from 'vue-router'

//引入组件
import Index from '../pages'
import Home from '../pages/home/home'
import Login from '../pages/login/login'
import Register from '../pages/register/register'
import Center from '../pages/center/center'
import Storeup from '../pages/storeup/list'
import News from '../pages/news/news-list'
import NewsDetail from '../pages/news/news-detail'
import xueyuanList from '../pages/xueyuan/list'
import xueyuanDetail from '../pages/xueyuan/detail'
import xueyuanAdd from '../pages/xueyuan/add'
import jiaolianList from '../pages/jiaolian/list'
import jiaolianDetail from '../pages/jiaolian/detail'
import jiaolianAdd from '../pages/jiaolian/add'
import cheliangxinxiList from '../pages/cheliangxinxi/list'
import cheliangxinxiDetail from '../pages/cheliangxinxi/detail'
import cheliangxinxiAdd from '../pages/cheliangxinxi/add'
import kaoshixinxiList from '../pages/kaoshixinxi/list'
import kaoshixinxiDetail from '../pages/kaoshixinxi/detail'
import kaoshixinxiAdd from '../pages/kaoshixinxi/add'
import jiaxiaoxinxiList from '../pages/jiaxiaoxinxi/list'
import jiaxiaoxinxiDetail from '../pages/jiaxiaoxinxi/detail'
import jiaxiaoxinxiAdd from '../pages/jiaxiaoxinxi/add'
import jiaofeixinxiList from '../pages/jiaofeixinxi/list'
import jiaofeixinxiDetail from '../pages/jiaofeixinxi/detail'
import jiaofeixinxiAdd from '../pages/jiaofeixinxi/add'
import jiaxiaojiaolianList from '../pages/jiaxiaojiaolian/list'
import jiaxiaojiaolianDetail from '../pages/jiaxiaojiaolian/detail'
import jiaxiaojiaolianAdd from '../pages/jiaxiaojiaolian/add'
import yuyuejiaolianList from '../pages/yuyuejiaolian/list'
import yuyuejiaolianDetail from '../pages/yuyuejiaolian/detail'
import yuyuejiaolianAdd from '../pages/yuyuejiaolian/add'
import kechengxinxiList from '../pages/kechengxinxi/list'
import kechengxinxiDetail from '../pages/kechengxinxi/detail'
import kechengxinxiAdd from '../pages/kechengxinxi/add'
import peixunxinxiList from '../pages/peixunxinxi/list'
import peixunxinxiDetail from '../pages/peixunxinxi/detail'
import peixunxinxiAdd from '../pages/peixunxinxi/add'
import cheliangfenpeiList from '../pages/cheliangfenpei/list'
import cheliangfenpeiDetail from '../pages/cheliangfenpei/detail'
import cheliangfenpeiAdd from '../pages/cheliangfenpei/add'
import tongzhixinxiList from '../pages/tongzhixinxi/list'
import tongzhixinxiDetail from '../pages/tongzhixinxi/detail'
import tongzhixinxiAdd from '../pages/tongzhixinxi/add'
import yuyuebaokaoList from '../pages/yuyuebaokao/list'
import yuyuebaokaoDetail from '../pages/yuyuebaokao/detail'
import yuyuebaokaoAdd from '../pages/yuyuebaokao/add'
import quxiaobaokaoList from '../pages/quxiaobaokao/list'
import quxiaobaokaoDetail from '../pages/quxiaobaokao/detail'
import quxiaobaokaoAdd from '../pages/quxiaobaokao/add'

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}

//配置路由
export default new VueRouter({
	routes:[
		{
      path: '/',
      redirect: '/index/home'
    },
		{
			path: '/index',
			component: Index,
			children:[
				{
					path: 'home',
					component: Home
				},
				{
					path: 'center',
					component: Center,
				},
				{
					path: 'storeup',
					component: Storeup
				},
				{
					path: 'news',
					component: News
				},
				{
					path: 'newsDetail',
					component: NewsDetail
				},
				{
					path: 'xueyuan',
					component: xueyuanList
				},
				{
					path: 'xueyuanDetail',
					component: xueyuanDetail
				},
				{
					path: 'xueyuanAdd',
					component: xueyuanAdd
				},
				{
					path: 'jiaolian',
					component: jiaolianList
				},
				{
					path: 'jiaolianDetail',
					component: jiaolianDetail
				},
				{
					path: 'jiaolianAdd',
					component: jiaolianAdd
				},
				{
					path: 'cheliangxinxi',
					component: cheliangxinxiList
				},
				{
					path: 'cheliangxinxiDetail',
					component: cheliangxinxiDetail
				},
				{
					path: 'cheliangxinxiAdd',
					component: cheliangxinxiAdd
				},
				{
					path: 'kaoshixinxi',
					component: kaoshixinxiList
				},
				{
					path: 'kaoshixinxiDetail',
					component: kaoshixinxiDetail
				},
				{
					path: 'kaoshixinxiAdd',
					component: kaoshixinxiAdd
				},
				{
					path: 'jiaxiaoxinxi',
					component: jiaxiaoxinxiList
				},
				{
					path: 'jiaxiaoxinxiDetail',
					component: jiaxiaoxinxiDetail
				},
				{
					path: 'jiaxiaoxinxiAdd',
					component: jiaxiaoxinxiAdd
				},
				{
					path: 'jiaofeixinxi',
					component: jiaofeixinxiList
				},
				{
					path: 'jiaofeixinxiDetail',
					component: jiaofeixinxiDetail
				},
				{
					path: 'jiaofeixinxiAdd',
					component: jiaofeixinxiAdd
				},
				{
					path: 'jiaxiaojiaolian',
					component: jiaxiaojiaolianList
				},
				{
					path: 'jiaxiaojiaolianDetail',
					component: jiaxiaojiaolianDetail
				},
				{
					path: 'jiaxiaojiaolianAdd',
					component: jiaxiaojiaolianAdd
				},
				{
					path: 'yuyuejiaolian',
					component: yuyuejiaolianList
				},
				{
					path: 'yuyuejiaolianDetail',
					component: yuyuejiaolianDetail
				},
				{
					path: 'yuyuejiaolianAdd',
					component: yuyuejiaolianAdd
				},
				{
					path: 'kechengxinxi',
					component: kechengxinxiList
				},
				{
					path: 'kechengxinxiDetail',
					component: kechengxinxiDetail
				},
				{
					path: 'kechengxinxiAdd',
					component: kechengxinxiAdd
				},
				{
					path: 'peixunxinxi',
					component: peixunxinxiList
				},
				{
					path: 'peixunxinxiDetail',
					component: peixunxinxiDetail
				},
				{
					path: 'peixunxinxiAdd',
					component: peixunxinxiAdd
				},
				{
					path: 'cheliangfenpei',
					component: cheliangfenpeiList
				},
				{
					path: 'cheliangfenpeiDetail',
					component: cheliangfenpeiDetail
				},
				{
					path: 'cheliangfenpeiAdd',
					component: cheliangfenpeiAdd
				},
				{
					path: 'tongzhixinxi',
					component: tongzhixinxiList
				},
				{
					path: 'tongzhixinxiDetail',
					component: tongzhixinxiDetail
				},
				{
					path: 'tongzhixinxiAdd',
					component: tongzhixinxiAdd
				},
				{
					path: 'yuyuebaokao',
					component: yuyuebaokaoList
				},
				{
					path: 'yuyuebaokaoDetail',
					component: yuyuebaokaoDetail
				},
				{
					path: 'yuyuebaokaoAdd',
					component: yuyuebaokaoAdd
				},
				{
					path: 'quxiaobaokao',
					component: quxiaobaokaoList
				},
				{
					path: 'quxiaobaokaoDetail',
					component: quxiaobaokaoDetail
				},
				{
					path: 'quxiaobaokaoAdd',
					component: quxiaobaokaoAdd
				},
			]
		},
		{
			path: '/login',
			component: Login
		},
		{
			path: '/register',
			component: Register
		},
	]
})
